local zong__xiangzui = fk.CreateSkill {
  name = "zong__xiangzui",
}

Fk:loadTranslationTable{
  ["zong__xiangzui"] = "相罪",
  [":zong__xiangzui"] = "出牌阶段限一次，你可以弃置一张牌，观看一名其他角色的手牌，且你可以视为对其使用一张火【杀】或【火攻】。",
  ["#zong__xiangzui-active"] = "相罪：弃置一张牌，选择一名其他角色并观看其手牌，随后可以视为对其使用火【杀】或【火攻】",
  ["#zong__xiangzui-hand"] = "相罪：观看%dest的手牌",
  ["#zong__xiangzui-choice"] = "相罪：请选择要视为使用的卡牌",
  ["fire__slash"] = "火【杀】",
  ["fire_attack"] = "【火攻】",
}

zong__xiangzui:addEffect("active", {
  anim_type = "attack",
  prompt = "#zong__xiangzui-active",
  max_phase_use_time = 1,
  phase = "play",
  card_num = 1,
  target_num = 1,

  can_use = function(self, player)
    return player:usedSkillTimes(zong__xiangzui.name, Player.HistoryPhase) < 1
  end,

  card_filter = function(self, player, to_select, selected)
    return #selected == 0
    and not player:prohibitDiscard(to_select)
  end,

  target_filter = function(self, player, to_select, selected)
    return #selected == 0
    and to_select ~= player
    and not to_select:isKongcheng()
  end,

  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local discard_card = effect.cards[1]

    room:throwCard(discard_card, zong__xiangzui.name, player, player)

    room:viewCards(player, { cards = target:getCardIds("h"), skill_name = "zong__xiangzui", prompt = "#zong__xiangzui-hand::"..target.id })
    for _, p in ipairs(room:getOtherPlayers(player, false)) do
      p:doNotify("GameLog", {
      type = "#know_hand",
      from = player.id,
      to = {target.id},
      toast = true,
      })
    end

    local choice = room:askToChoice(player, {
      choices = {"fire__slash", "fire_attack"},
      skill_name = zong__xiangzui.name,
    })

    if choice == "fire__slash" then
      room:useVirtualCard("fire__slash", nil, player, target, zong__xiangzui.name, true)
    elseif choice == "fire_attack" then
      room:useVirtualCard("fire_attack", nil, player, target, zong__xiangzui.name, true)
    end
  end,
})

return zong__xiangzui